import request from '@/utils/request'

// 获取公司角色接口
export const getRoleList = (params) => request({
  url: '/sys/role',
  params
})

// 根据id获取公司信息
export const getCompanyInfo = (id) => request({
  url: `/company/${id}`
})

// 删除角色功能
export const deleteRole = (id) => request({
  url: `/sys/role/${id}`,
  method: 'delete'
})

// 编辑角色功能
export const updateRole = (data) => request({
  url: `/sys/role/${data.id}`,
  method: 'put',
  data
})

// 获取角色详情接口
export const getRoleDetail = (id) => request({
  url: `/sys/role/${id}`
})

// 添加角色接口
export const addRole = (data) => request({
  url: '/sys/role',
  method: 'post',
  data
})

// 给角色分配权限弹出层
export const assignPerm = (data) => request({
  url: '/sys/role/assignPrem',
  method: 'put',
  data
})
